};
/* local function prototypes */
-static void sha1(const unsigned char *data, uint32_t length, unsigned char *hash);
+static void sha1(const unsigned char *data, uint32_t length,
+ unsigned char *hash);
static uint32_t TCG_ShutdownPreBootInterface(uint32_t ebx);
static uint32_t HashAll32(struct hai *hai, unsigned char *hash,
uint32_t magic, uint32_t ecx, uint32_t edx);
static uint32_t HashLogExtendEvent32(struct hleei_short *hleei_s,
struct hleeo *hleeo,
- uint32_t magic, uint32_t ecx, uint32_t edx);
+ uint32_t magic, uint32_t ecx,
+ uint32_t edx);
static uint32_t HashLogEvent32(struct hlei *hlei, struct hleo *hleo,
uint32_t ebx, uint32_t ecx, uint32_t edx);
static uint32_t PassThroughToTPM32(struct pttti *pttti, struct pttto *pttto,
}
static
-uint32_t MA_Transmit(unsigned char *cmdbuffer,
- unsigned char *respbuffer,
+uint32_t MA_Transmit(unsigned char *cmdbuffer, unsigned char *respbuffer,
uint32_t respbufferlen)
{
uint32_t rc = 0;
uint32_t ctr = 0;
/* get RSDT from RSDP */
rsdt = (struct acpi_20_rsdt *)rsdp->rsdt_address;
- /* rsdt may be anywhere in 32bit space */
length = rsdt->header.length;
off = 36;
while ((off + 3) < length) {
/* try all pointers to structures */
tcpa = (struct acpi_20_tcpa *)rsdt->entry[ctr];
/* valid TCPA ACPI table ? */
- if (ACPI_2_0_TCPA_SIGNATURE == tcpa->header.signature &&
- acpi_validate_entry(&tcpa->header) == 0) {
+ if (ACPI_2_0_TCPA_SIGNATURE == tcpa->header.signature
+ && acpi_validate_entry(&tcpa->header) == 0) {
found = 1;
break;
}
tcpa = 0;
}
- /* initialize the TCPA part of the EBDA with our data */
tcpa_acpi.tcpa_ptr = tcpa;
tcpa_acpi.lasa_last_ptr = 0;
tcpa_acpi.entry_count = 0;
}
static
-uint32_t SendCommand32(uint32_t idx,
- struct pttto *pttto,
- uint32_t size_ptto)
+uint32_t SendCommand32(uint32_t idx, struct pttto *pttto, uint32_t size_ptto)
{
uint32_t rc = 0;
struct pttti *pttti = (struct pttti *)TCG_CommandList[idx];
uint32_t pttto_size = sizeof(_pttto);
if (rc == 0) {
- rc = SendCommand32(IDX_CMD_TPM_Startup_0x01, pttto, pttto_size);
+ rc = SendCommand32(IDX_CMD_TPM_Startup_0x01, pttto,
+ pttto_size);
}
if (rc == 0 && physpres != 0) {
static
-uint32_t HashLogExtendEvent32(struct hleei_short *hleei_s,
- struct hleeo *hleeo,
- uint32_t magic,
- uint32_t ecx,
- uint32_t edx)
+uint32_t HashLogExtendEvent32(struct hleei_short *hleei_s, struct hleeo *hleeo,
+ uint32_t magic, uint32_t ecx, uint32_t edx)
{
uint32_t rc = 0;
uint16_t size;
static
-uint32_t PassThroughToTPM32(struct pttti *pttti,
- struct pttto *pttto,
- uint32_t magic,
- uint32_t ecx,
- uint32_t edx)
+uint32_t PassThroughToTPM32(struct pttti *pttti, struct pttto *pttto,
+ uint32_t magic, uint32_t ecx, uint32_t edx)
{
uint32_t rc = 0;
uint8_t *cmd32;
static
uint32_t HashLogEvent32(struct hlei *hlei, struct hleo *hleo,
- uint32_t ebx,
- uint32_t ecx,
- uint32_t edx)
+ uint32_t ebx, uint32_t ecx, uint32_t edx)
{
uint32_t rc = 0;
uint16_t size;
static
uint32_t HashAll32(struct hai *hai, unsigned char *hash,
- uint32_t magic,
- uint32_t ecx,
- uint32_t edx)
+ uint32_t magic, uint32_t ecx, uint32_t edx)
{
uint32_t rc = 0;
static
uint32_t TSS32(struct ti *ti, struct to *to,
- uint32_t ebx,
- uint32_t ecx,
- uint32_t edx)
+ uint32_t ebx, uint32_t ecx, uint32_t edx)
{
uint32_t rc = 0;
if (TCG_IsShutdownPreBootInterface() == 0) {
static
uint32_t CompactHashLogExtendEvent32(unsigned char *buffer,
- uint32_t info,
- uint32_t magic,
- uint32_t length,
- uint32_t pcrindex,
- uint32_t *edx_ptr)
+ uint32_t info,
+ uint32_t magic,
+ uint32_t length,
+ uint32_t pcrindex,
+ uint32_t *edx_ptr)
{
uint32_t rc = 0;
struct hleeo hleeo;
/* treat data in 64-byte chunks */
for (offset = 0; length - offset >= 64; offset += 64) {
- /* copy into the 'w' array */
memcpy(w, data32 + offset, 64);
- /* hash the block in the 'w' array */
sha1_block((uint32_t *)w, ctx);
bits += (64 * 8);
}
}
-uint32_t TCGInterruptHandler(pushad_regs_t *regs, uint32_t esds, uint32_t flags_ptr)
+uint32_t TCGInterruptHandler(pushad_regs_t *regs, uint32_t esds,
+ uint32_t flags_ptr)
{
uint16_t DS = esds >> 16;
uint16_t ES = esds & 0xffff;
}
}
break;
-
case 0x01:
regs->u.r32.eax =
HashLogExtendEvent32((struct hleei_short*)